package cn.slipi.admin.controller;

import cn.slipi.admin.common.annotation.NoLogin;
import cn.slipi.admin.common.response.JsonResponse;
import cn.slipi.admin.controller.form.health.HealthForm;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * 健康检查接口
 *
 * @author lee
 * @date 2019-03-17
 * @since 1.0.0
 */
@RestController
public class HealthController {
    @NoLogin
    @GetMapping("/health")
    public String health() {
        return "i am working - admin";
    }

    @NoLogin
    @GetMapping("/shutdown")
    public String shutdown() {
        return "i am closing - admin";
    }

    @NoLogin
    @PostMapping("/post/watch")
    public JsonResponse<HealthForm> postWatch(@RequestBody HealthForm healthForm) {
        JsonResponse<HealthForm> responseVo = new JsonResponse<>();
        responseVo.setData(healthForm);
        return responseVo;
    }
}
